package com.njwb.day01;

import java.util.Scanner;

public class buzhidao {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("1.管理员   2.教师   3.学生   4.退出");
            System.out.print("请输入你的身份");
            int role = scanner.nextInt();
            switch (role) {
                case 1:
                    System.out.println("欢迎管理员");
                    while(true) {
                        Scanner sc1 = new Scanner(System.in);

                        System.out.println("1.添加用户   2.删除用户   3.查看日志   4.返回");
                        System.out.print("请选择操作：");
                        int function1 = sc1.nextInt();
                        switch (function1) {
                            case 1:
                                System.out.println("添加成功");
                                break;
                            case 2:
                                System.out.println("删除成功");
                                break;
                            case 3:
                                System.out.println("这是日志");
                                break;
                            case 4:
                                break;
                            default:
                                System.out.println("操作不合法");
                                break;
                        }
                        if(function1 == 4) {
                            break;
                        }
                    }
                    break;
                case 2:
                    System.out.println("欢迎教师");
                    while(true) {
                    Scanner sc2 = new Scanner(System.in);

                    System.out.println("1.录入成绩   2.查看学生列表   3.返回");
                    System.out.print("请选择操作：");
                    int function2 = sc2.nextInt();
                    switch (function2) {
                        case 1:
                            System.out.println("录入成功");
                            break;
                        case 2:
                            System.out.println("这是学生列表");
                            break;
                        case 3:
                            break;
                        default:
                            System.out.println("操作不合法");
                            break;
                    }
                    if(function2 == 3) {
                        break;
                    }
                }
break;
                case 3:
                    System.out.println("欢迎学生");
                    while(true){
                    Scanner sc3 = new Scanner(System.in);

                    System.out.println("1.查看成绩   2.选课   3.返回");
                    System.out.print("请选择操作：");
                    int function3 = sc3.nextInt();
                    switch (function3) {
                        case 1:
                            System.out.println("这是成绩");
                            break;
                        case 2:
                            System.out.println("这是课");
                            break;
                        case 3:
                            break;
                        default:
                            System.out.println("操作不合法");
                            break;
                    }
                    if(function3 == 3) {
                        break;
                    }
                }
                break;
                case 4:
                    break;
                default:
                    System.out.println("身份错误");
                    break;
            }
            if (role==4){
                break;
            }
        }
    }
}